<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
	<title>详细信息</title>
	<hdjs />

	<css file="__PUBLIC__/Css/mod.base.css" />
</head>
<body>
	<form action="{:U('state')}" method="post" enctype='multipart/form-data' class='hd-form'>

		<div class="hd-menu-list">
			<ul>
				<li>
					<a href="{:U('OrderLists/index',array('is_deposit'=>$_GET['is_deposit']))}" >订单列表</a>
				</li>
				<li class="active">
					<a href="javascript:;" >编辑订单</a>
				</li>

			</ul>
		</div>
		<div class="hd-title-header">订单详细</div>
		<table class='hd-table hd-table-form hd-form'>
			<tbody>
				<tr>
					<th class="hd-w100">订单号</th>
					<td>{$data.sn}</td>
				</tr>
				<tr>
					<th class="hd-w100">下单时间</th>
					<td>{$data.addtime|date='Y-m-d H:i:s',###}</td>
				</tr>
				<tr>
					<th class="hd-w100">订单状态</th>
					<td>{$data.order_status|get_order_status}</td>
				</tr>
				<tr>
					<th class="hd-w100">订单金额</th>
					<td>{$data.pay_amount|format_price}</td>
				</tr>
			</tbody>
		</table>
		<div class="hd-title-header">
			收货信息
			<if condition='$data["order_status"] elt 4'>
			<a href="{:U('edit_consignee',array('id'=>$data['order_id']))}">修改</a>
			</if>
		</div>
		<table class='hd-table hd-table-form hd-form'>
			<tbody>
				<tr>
					<th class="hd-w100">收货人</th>
					<td>{$data.consignee}</td>
					<th class="hd-w100">邮箱</th>
					<td>{$data.email}</td>
					<th class="hd-w100">手机</th>
					<td>{$data.phone}</td>
				</tr>
				<tr>
					<th class="hd-w100">地址</th>
					<td>{$data.address}</td>
					<th class="hd-w100">邮编</th>
					<td>{$data.zipcode}</td>
					<th class="hd-w100"></th>
					<td></td>
				</tr>
				
			</tbody>
		</table>
		<div class="hd-title-header">
			配送方式
			<if condition='$data["order_status"] elt 4'>
			<a href="{:U('edit_shipping',array('id'=>$data['order_id']))}">修改</a>
			</if>
		</div>
		<table class='hd-table hd-table-form hd-form'>
			<tbody>
				<tr>
					<th class="hd-w100">配送方式</th>
					<td>{$data.distribution}</td>
				</tr>
				<tr>
					<th class="hd-w100">运费</th>
					<td>{$data.distribution_amount|format_price}</td>
				</tr>
				
				<tr>
					<th class="hd-w100">
						运单号
					</th>
					<td>
						<if condition='$data["distribution_sn"]'> {$data.distribution_sn}<else />
						未发货
						</if>
					</td>
				</tr>
			</tbody>
		</table>
		<div class="hd-title-header">
			商品列表
			
		</div>
		<table class='hd-table hd-table-list hd-form'>
			<thead>
				<tr>
					<td class='hd-w80'>序号</td>
					<!-- <td class='hd-w80'>货号</td> -->
					<td>商品名称</td>
					<if condition='$data["is_deposit"]'>
					<td class='hd-w80'>预售价格</td>
					<td class='hd-w80'>定金</td>
					<else />
					<td class='hd-w80'>价格</td>
					</if>
					<td class='hd-w80'>购买数量</td>
					<td class='hd-w80'>小计</td>
					<td class='hd-w100'>剩余库存</td>
					
				</tr>
			</thead>
			<tbody>
				<foreach name='data.detail' item='v'>
					<tr>
						<td>{$key+1}</td>
						<!-- <td>{$v.goods_sn}</td> -->
						<td>
							<a href="{$v.goods_gid|get_goods_url}" target="_blank">
							
							{$v.goods_name}
							</a>
						</td>
						
						<if condition='$data["is_deposit"]'>
						<td>{$v.goods_price|format_price}</td>
						<td>{$data.deposit|format_price}</td>
						<else />
						<td>{$v.goods_price|format_price}</td>
						</if>
						<td>{$v.goods_num}</td>
						<td><?php echo format_price($v['goods_price']*$v['goods_num']) ?></td>
						<td>{$v.goods_gid|get_goods_num}</td>
					</tr>
				</foreach>
				<if condition='$data["is_deposit"]'>
					<tr>
						<td colspan="7" align='right'>
							
						<p>商品定金 {$data.deposit|format_price} + 运费 {$data.distribution_amount|format_price}  = </p>
						<p>订单价格 {$data.pay_amount|format_price}</p>

						</td>
					</tr>
				<else />
					<tr>
					<td colspan="7" align='right'>
						<p>商品总金额 {$data.goods_amount|format_price} + 运费 {$data.distribution_amount|format_price}  = </p>
						<p>订单价格 {$data.pay_amount|format_price}</p>
					</td>
				</tr>
				</if>
				
			</tbody>	
			
		</table>
		<div class="hd-title-header">
			订单状态
		</div>
		<table class='hd-table hd-table-form hd-form'>
			<tr>
				<td>
					{$data.order_status|get_order_status}
				</td>
			</tr>
			<if condition='$data["is_abnormal"]'>
			<tr>
				<td>
					<strong>{$data.is_abnormal|get_abnormal}</strong>
					理由：{$data.abnormal}
				</td>
			</tr>
			
			 </if>
			 <if condition='$data["is_pay"]'>
			<tr>
				<td>
					订单已经完全支付 <?php echo format_price($data['goods_amount']+$data['distribution_amount']) ?>
				</td>
			</tr>
			</if>
		</table>
		<div class="hd-position-bottom">
			<input type="hidden" name="order_id" value="{$data.order_id}" />

			<input type="button" class="hd-btn-xm hd-btn" onclick="location.href='{:U('OrderLists/index')}'" value="返回"/>

			<input type="button" class="hd-btn-xm hd-btn" onclick="location.href='{:U('OrderLists/change',array('id'=>$_GET['order_id'],'order_status'=>2))}'" value="支付"/>

			<input type="button" class="hd-btn-xm hd-btn" onclick="location.href='{:U('OrderLists/change',array('id'=>$_GET['order_id'],'order_status'=>3))}'" value="审核"/>

			<if condition='$data["is_deposit"]'>
				<if condition='!$data["c_deposit"]'>
				<input type="button" class="hd-btn-xm hd-btn" onclick="location.href='{:U('OrderLists/deposit',array('id'=>$_GET['order_id'],'c_deposit'=>1))}'" value="可支付剩下金额"/>

				

				<elseif condition='!$data["is_pay"]' />
			
					
						<input type="button" class="hd-btn-xm hd-btn" onclick="location.href='{:U('OrderLists/deposit',array('id'=>$_GET['order_id'],'c_deposit'=>0))}'" value="不可支付剩下金额"/>
					
						<input type="button" class="hd-btn-xm hd-btn" onclick="location.href='{:U('OrderLists/paydeposit',array('id'=>$_GET['order_id']))}'" value="补齐金额"/>
				  

					
				</if>
			</if>

			<input type="button" class="hd-btn-xm hd-btn" onclick="location.href='{:U('OrderLists/change',array('id'=>$_GET['order_id'],'order_status'=>4))}'" value="发货"/>	

			<input type="button" class="hd-btn-xm hd-btn" onclick="location.href='{:U('OrderLists/change',array('id'=>$_GET['order_id'],'order_status'=>5))}'" value="成功"/>

			<input type="button" class="hd-btn-xm hd-btn" onclick="location.href='{:U('OrderLists/change',array('id'=>$_GET['order_id'],'order_status'=>6))}'" value="终止"/>


		</div>
	</form>
</body>
</html>